package com.xiaoxi.bridgemode.realization;

/**
 * @Author xiaoxi
 * @ProjectName design_mode
 * @PackageName com.xiaoxi.bridgemode.realization
 * @ClassName StringDisplayImpl
 * @Description TODO
 * @Date 2023/3/13 19:54
 * @Version 1.0
 */
public class StringDisplayImpl implements DisplayImpl {

    private String str;

    public StringDisplayImpl(String str) {
        this.str = str;
    }

    @Override
    public void rawOpen() {
        System.out.print("+");
        for (int i = 0; i < str.length(); i++) {
            System.out.print("-");
        }
        System.out.print("+\n");
    }

    @Override
    public void rawPrint() {
        System.out.print("+");
        for (int i = 0; i < str.length(); i++) {
            System.out.print(str.charAt(i));
        }
        System.out.print("+\n");
    }

    @Override
    public void rawClose() {
        System.out.print("+");
        for (int i = 0; i < str.length(); i++) {
            System.out.print("-");
        }
        System.out.print("+\n");
    }

}
